package com.orchidea.uml.view
{
import flash.events.KeyboardEvent;

import mx.containers.Canvas;
import mx.core.UIComponent;

public class DiagramEditor extends Canvas
{
    private var _pointerTool : String;

    protected var _documentView : DiagramView;
    public function set documentView(value:DiagramView):void
    {
        if(documentLayer != null)
        {
            documentLayer.addChild(value);
        }

        _documentView = value;
    }
    public function get documentView():DiagramView
    {
        return _documentView;
    }

    protected var viewLayer : Canvas;
    public var documentLayer : UIComponent;
    public var feedbackLayer : UIComponent;

    /**
     * Initialize the child components of this editor.
     */
    protected override function createChildren():void
    {
        super.createChildren();

        viewLayer = new Canvas();
        addChild(viewLayer);

        documentLayer = new UIComponent();
        viewLayer.addChild(documentLayer);

        feedbackLayer = new UIComponent();
        viewLayer.addChild(feedbackLayer);

        if(_documentView != null)
        {
            documentLayer.addChild(_documentView);
        }
    }

    /**
     * Override default key down handling in Container that would affect scroll bar position, etc.
     */
    override protected function keyDownHandler(event:KeyboardEvent):void
    {
    }
}
}